<template>
  <div class="full sys">
    <div class="left">
      <el-menu
        default-active="/user"
        class="el-menu-vertical-demo"
        @select="handleSelect"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b"
      >
        <el-menu-item index="/user">
          <i class="el-icon-menu"></i>
          <span slot="title">导航一</span>
        </el-menu-item>
        <el-menu-item index="/plan">
          <i class="el-icon-menu"></i>
          <span slot="title">导航二</span>
        </el-menu-item>
        <el-menu-item index="/set">
          <i class="el-icon-document"></i>
          <span slot="title">导航三</span>
        </el-menu-item>
      </el-menu>
    </div>
    <div class="right center">
      <router-view />
    </div>
  </div>
</template>

<script>
export default {
  name: "SysComp",
  components: {},
  data() {
    return {};
  },
  methods: {
    handleSelect(path) {
      this.$router.push(path);
      // console.log(key, keyPath);
    },
  },
  mounted() {
    // 只要 渲染 /sys/index.vue 组件，
    // 直接跳转到 '/pages/sys/user' 该路由下
    this.$router.push("/user");
  },
};
</script>

<style scoped lang="scss">
.sys {
  display: flex;
  flex-direction: row;
  .left {
    width: 300px;
    background-color: purple;
  }
  .right {
    flex: 1;
    background-color: aqua;
  }
}
</style>
